#pragma once
#include <osg/Vec3d>

#include "CmdHandler3.h"

class Ent;
class RotateHandler : public CmdHandler3
{
	Q_OBJECT
public:
	Q_INVOKABLE RotateHandler();
	~RotateHandler();

	virtual void input(const QVariant& data, const QString& rawInput, CommandSource cs) override;
	void rotate(std::vector<std::shared_ptr<Ent>>& result, Scene* scene, double angle);
	bool getNearEndPtAndDir(std::shared_ptr<Ent>& ent);

	osg::Vec3d m_pt;
	osg::Vec3d m_ptDir;
	osg::Vec3d m_start;
	osg::Vec3d m_end;
	std::vector<std::shared_ptr<Ent>> m_origins;
};
